import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from "./store";
import ElementPlus from 'element-plus';
import '@/plugin/iconfont.js';
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import './components/SuperSearch/instance-config.js'
import { ElMessage } from 'element-plus'
import { h } from 'vue'

const app = createApp(App)
app.use(router)
app.use(store)
app.use(ElementPlus, {
    locale: zhCn,
})

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
app.mount('#app')


// window.onerror = function (msg, url, line, col, error) {
//     ElMessage({
//         message: h('p', { style: 'padding:15px', }, [
//           h('div', null, '文件发生报错 : '+ url),
//           h('br'), 
//           h('div', null, "报错内容是 : "+msg),
//         ]),
//         type: 'error',
//         duration:5000,
//     })
// }